package com.stoneframe.service.manageAuthorize;

import java.util.List;

import org.springframework.stereotype.Service;
import com.stoneframe.service.BaseService;
import com.stoneframe.util.baseApp.PageData;
import com.stoneframe.util.baseApp.ProviderHelper;

@Service(value="sysModuleService")
public class SysModuleService extends BaseService {
	public SysModuleService(){
		super("SysModuleMapper");
	}

	@Override
	public List<PageData> listAll(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		if(ProviderHelper.isSystem()){ //是否是管理员
			return (List<PageData>)dao.findForList(mapper+".listAll", pd);
		}else{
			PageData userData=ProviderHelper.getCurrentUser();
			pd.put("userId", userData.getString("userId"));
			return (List<PageData>)dao.findForList(mapper+".listAllPerssion", pd);
		}
	}
	
	
	
}
